home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11687 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: svnews.ubinet.ubs.com!ubszh!ian.johnston@ubs.com
  2. From: gzhjis@ubszh.net.ch (Ian Johnston (by ubsswop))
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Can you overload a constructor?
  5. Date: 15 Mar 1996 18:00:20 GMT
  6. Organization: UBS
  7. Distribution: world
  8. Message-ID: <4icb7k$2fa@ubszh.fh.zh.ubs.com>
  9. References: <Do859K.K9B@watserv3.uwaterloo.ca> <31483CDC.4B0C@staff.ichange.com> <4ibqan$br5@si-nic.hrz.uni-siegen.de>
  10. NNTP-Posting-Host: nol2179.fh.zh.ubs.com
  11.  
  12. In article <4ibqan$br5@si-nic.hrz.uni-siegen.de>, plrunu@informatik.uni-siegen.de (Runu Knips) writes:
  13. |> Sorry, it is impossible to OVERLOAD a constructor. A constructor
  14. |> is ALWAYS called, if there is one for a class. And before it
  15. |> get called, any constructor for superclasses get called.
  16. |> 
  17. |> Likewise with the destructor (but the destructor of the super-
  18. |> classes will be called AFTER the destructor).
  19. |> 
  20. |> There are no other functions which behave like this, so it can't
  21. |> be called overloading. You cannot supress the constructor of
  22. |> a superclass, but you can overload and supress a virtual function
  23. |> of a superclass.
  24. |> 
  25.  
  26. You are mixing up overloading and overriding.
  27.  
  28. Overloading is where several functions have the same name, but different
  29. argument lists.
  30.  
  31. Overriding is where a function in a derived class is used in place of
  32. a function in a base class.
  33.  
  34.  
  35. Ian
  36.